<template>
  <div class="body">
    <h3 v-if="!isHaveDiagnose" align="center">请在诊断评估中新增确诊诊断！</h3>
    <el-row
      v-if="
        diagnose.cerebralInfarction === '1' ||
          diagnose.hematencephalon === '1' ||
          diagnose.isuia === '1' ||
          diagnose.cas === '1'
      "
    >
      <!-- <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">评分记录</div>
        </el-row>
        <el-row>
          <el-row class="card">
              <el-row class="card-content" v-for="(value,index) in all_data" :key="index">
                  <el-row style="display: inline-block;">{{"更新时间："+value.updatedAt}}</el-row>
                  <el-row style="display: inline-block; margin-left: 40px;"></el-row>
                  <el-row style="display: inline-block; margin-left: 40px;">3</el-row>
              </el-row>
          </el-row>
        </el-row>
      </el-row> -->
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">FAST评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <el-form-item label="面瘫" label-width="45px">
                  <el-radio-group
                    v-model="checkValue.fast.fast.fast1"
                    @change="changeFAST()"
                  >
                    <el-radio
                      v-for="(fast1Item, fast1Index) in fast1List"
                      :key="'fast1' + fast1Index"
                      :label="fast1Item.code"
                    >
                      {{ fast1Item.name }}
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="上肢无力" label-width="70px">
                  <el-radio-group
                    v-model="checkValue.fast.fast.fast2"
                    @change="changeFAST()"
                  >
                    <el-radio
                      v-for="(fast2Item, fast2Index) in fast2List"
                      :key="'fast2' + fast2Index"
                      :label="fast2Item.code"
                    >
                      {{ fast2Item.name }}
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="语言障碍" label-width="70px">
                  <el-radio-group
                    v-model="checkValue.fast.fast.fast3"
                    @change="changeFAST()"
                  >
                    <el-radio
                      v-for="(fast3Item, fast3Index) in fast3List"
                      :key="'fast3' + fast3Index"
                      :label="fast3Item.code"
                    >
                      {{ fast3Item.name }}
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="眼球凝视" label-width="70px">
                  <el-radio-group
                    v-model="checkValue.fast.fast.fast4"
                    @change="changeFAST()"
                  >
                    <el-radio
                      v-for="(fast4Item, fast4Index) in fast4List"
                      :key="'fast4' + fast4Index"
                      :label="fast4Item.code"
                    >
                      {{ fast4Item.name }}
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="失认/忽视" label-width="73px">
                  <el-radio-group
                    v-model="checkValue.fast.fast.fast5"
                    @change="changeFAST()"
                  >
                    <el-radio
                      v-for="(fast5Item, fast5Index) in fast5List"
                      :key="'fast5' + fast5Index"
                      :label="fast5Item.code"
                    >
                      {{ fast5Item.name }}
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <span>
                  FAST评分:
                  <el-input
                    v-model="checkValue.fast.FASTScore"
                    style="width: 100px"
                    disabled
                  />分<el-input
                    v-model="checkValue.fast.FASTRisk"
                    style="width: 400px"
                    disabled
                  />
                </span>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">洼田吞咽</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.swallow.swallow">
                    <el-radio label="1"> 1级 (优) : 能顺利地1次将水咽下 </el-radio>
                    <el-radio label="2"> 2级 (良) : 分2次以上，能不呛咳地咽下 </el-radio>
                    <el-radio label="3"> 3级 (中) : 能1次咽下，但有呛咳 </el-radio>
                    <el-radio label="4"> 4级 (可) : 分2次以上咽下，但有呛咳 </el-radio>
                    <el-radio label="5"> 5级 (差) : 频繁呛咳，不能全部咽下 </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">入院Fisher分级</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.beFisher.beFisher">
                    <el-radio label="1">
                      0级 未见出血或仅脑室内出血或实质内出血(3%)
                    </el-radio>
                    <el-radio label="2"> Ⅰ级 仅见基底池出血(14%)否 </el-radio>
                    <el-radio label="3"> Ⅱ级 仅见周边脑池或侧裂池出血(38%) </el-radio>
                    <el-radio label="4">
                      Ⅲ级 广泛蛛网膜下腔出血伴脑实质内血肿(57%)
                    </el-radio>
                    <el-radio label="5">
                      Ⅳ级 基底池和周边脑池。侧裂池较厚积血(57%)
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">发病前mRS</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.beforeMRS.beforeMRS">
                    <el-radio label="0"> 0分 完全无症状 </el-radio>
                    <el-radio label="1">
                      1分 尽管有症状，但无明显功能障碍，能完成所有日常职责和活动
                    </el-radio>
                    <el-radio label="2">
                      2分 轻度残疾，不能完成病前所有活动，但不需要帮助，能照顾自己的事务
                    </el-radio>
                    <el-radio label="3">
                      3分 中度残疾，要求一些帮助，但行走不需要帮助
                    </el-radio>
                    <el-radio label="4">
                      4分 重度残疾，不能独立行走，无他人帮助不能满足自身需求
                    </el-radio>
                    <el-radio label="5">
                      5分 严重残疾，卧床、失禁、要求持续护理和关注
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">发病时mRS</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.onsetMRS.onsetMRS">
                    <el-radio label="0"> 0分 完全无症状 </el-radio>
                    <el-radio label="1">
                      1分 尽管有症状，但无明显功能障碍，能完成所有日常职责和活动
                    </el-radio>
                    <el-radio label="2">
                      2分 轻度残疾，不能完成病前所有活动，但不需要帮助，能照顾自己的事务
                    </el-radio>
                    <el-radio label="3">
                      3分 中度残疾，要求一些帮助，但行走不需要帮助
                    </el-radio>
                    <el-radio label="4">
                      4分 重度残疾，不能独立行走，无他人帮助不能满足自身需求
                    </el-radio>
                    <el-radio label="5">
                      5分 严重残疾，卧床、失禁、要求持续护理和关注
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">入院mRS</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.inMRS.inMRS">
                    <el-radio label="0"> 0分 完全无症状 </el-radio>
                    <el-radio label="1">
                      1分 尽管有症状，但无明显功能障碍，能完成所有日常职责和活动
                    </el-radio>
                    <el-radio label="2">
                      2分 轻度残疾，不能完成病前所有活动，但不需要帮助，能照顾自己的事务
                    </el-radio>
                    <el-radio label="3">
                      3分 中度残疾，要求一些帮助，但行走不需要帮助
                    </el-radio>
                    <el-radio label="4">
                      4分 重度残疾，不能独立行走，无他人帮助不能满足自身需求
                    </el-radio>
                    <el-radio label="5">
                      5分 严重残疾，卧床、失禁、要求持续护理和关注
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">入院GCS评分</div>
        </el-row>
        <el-form>
          <el-row>
            <el-row class="card">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-form-item label="睁眼状态">
                    <el-radio-group
                      v-model="checkValue.beGCS.beGCS.beGCS1"
                      @change="changebeGCSS()"
                    >
                      <el-radio label="1"> 1 无睁眼 </el-radio>
                      <el-radio label="2"> 2 疼痛刺激睁眼 </el-radio>
                      <el-radio label="3"> 3 语言刺激睁眼 </el-radio>
                      <el-radio label="4"> 4自发睁眼 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="语言状态">
                    <el-radio-group
                      v-model="checkValue.beGCS.beGCS.beGCS2"
                      @change="changebeGCSS()"
                    >
                      <el-radio label="1"> 1 无发音 </el-radio>
                      <el-radio label="2"> 2 只能发音 </el-radio>
                      <el-radio label="3"> 3 只能说 (不适当) 单词 </el-radio>
                      <el-radio label="4"> 4 言语错乱 </el-radio>
                      <el-radio label="5"> 5 正常交谈 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="运动状态">
                    <el-radio-group
                      v-model="checkValue.beGCS.beGCS.beGCS3"
                      @change="changebeGCSS()"
                    >
                      <el-radio label="1"> 1 无反应 </el-radio>
                      <el-radio label="2"> 2 异常伸展 (去脑状态) </el-radio>
                      <el-radio label="3"> 3 异常屈曲 (去皮层状态) </el-radio>
                      <el-radio label="4"> 4 对疼痛刺激屈曲反应 </el-radio>
                      <el-radio label="5"> 5 对疼痛刺激定位反应 </el-radio>
                      <el-radio label="6"> 6 按吩咐动作 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <span>
                    入院GCS评分:
                    <el-input
                      v-model="checkValue.beGCS.beGCSScore"
                      style="width: 100px"
                      disabled
                    />分<el-input
                      v-model="checkValue.beGCS.beGCSRisk"
                      style="width: 400px"
                      disabled
                    />
                  </span>
                </div>
              </el-row>
            </el-row>
          </el-row>
        </el-form>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">溶栓后24小时mRS评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.after24MRS.after24MRS">
                    <el-radio label="0"> 0分 完全无症状 </el-radio>
                    <el-radio label="1">
                      1分 尽管有症状，但无明显功能障碍，能完成所有日常职责和活动
                    </el-radio>
                    <el-radio label="2">
                      2分 轻度残疾，不能完成病前所有活动，但不需要帮助，能照顾自己的事务
                    </el-radio>
                    <el-radio label="3">
                      3分 中度残疾，要求一些帮助，但行走不需要帮助
                    </el-radio>
                    <el-radio label="4">
                      4分 重度残疾，不能独立行走，无他人帮助不能满足自身需求
                    </el-radio>
                    <el-radio label="5">
                      5分 严重残疾，卧床、失禁、要求持续护理和关注
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">住院GCS评分</div>
        </el-row>
        <el-form>
          <el-row>
            <el-row class="card">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-form-item label="睁眼状态">
                    <el-radio-group
                      v-model="checkValue.inGCS.inGCS.inGCS1"
                      @change="changeinGCS()"
                    >
                      <el-radio label="1"> 1 无睁眼 </el-radio>
                      <el-radio label="2"> 2 疼痛刺激睁眼 </el-radio>
                      <el-radio label="3"> 3 语言刺激睁眼 </el-radio>
                      <el-radio label="4"> 4自发睁眼 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="语言状态">
                    <el-radio-group
                      v-model="checkValue.inGCS.inGCS.inGCS2"
                      @change="changeinGCS()"
                    >
                      <el-radio label="1"> 1 无发音 </el-radio>
                      <el-radio label="2"> 2 只能发音 </el-radio>
                      <el-radio label="3"> 3 只能说 (不适当) 单词 </el-radio>
                      <el-radio label="4"> 4 言语错乱 </el-radio>
                      <el-radio label="5"> 5 正常交谈 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="运动状态">
                    <el-radio-group
                      v-model="checkValue.inGCS.inGCS.inGCS3"
                      @change="changeinGCS()"
                    >
                      <el-radio label="1"> 1 无反应 </el-radio>
                      <el-radio label="2"> 2 异常伸展 (去脑状态) </el-radio>
                      <el-radio label="3"> 3 异常屈曲 (去皮层状态) </el-radio>
                      <el-radio label="4"> 4 对疼痛刺激屈曲反应 </el-radio>
                      <el-radio label="5"> 5 对疼痛刺激定位反应 </el-radio>
                      <el-radio label="6"> 6 按吩咐动作 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <span>
                    住院GCS评分:
                    <el-input
                      v-model="checkValue.inGCS.inGCSScore"
                      style="width: 100px"
                      disabled
                    />分<el-input
                      v-model="checkValue.inGCS.inGCSRisk"
                      style="width: 400px"
                      disabled
                    />
                  </span>
                </div>
              </el-row>
            </el-row>
          </el-row>
        </el-form>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">住院Hunt-Hess评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.inHuntHess.inHuntHess">
                    <el-radio label="0"> 0级 未破裂动脉瘤 </el-radio>
                    <el-radio label="1"> 1级 无症状或轻微头痛 </el-radio>
                    <el-radio label="2"> 2级 中一重度头痛.脑膜刺激征.神经麻痹 </el-radio>
                    <el-radio label="3"> 3级 嗜睡，意识混浊，轻度局灶神经体征 </el-radio>
                    <el-radio label="4">
                      4级 昏迷，中或重度偏瘫，有早期去脑强直或自主神经功能紊乱
                    </el-radio>
                    <el-radio label="5"> 5级 深昏迷，去大脑强直，濒死状态 </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">住院CHADS2评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-checkbox-group
                    v-model="checkValue.inCHADS2.inCHADS2"
                    @change="changeinCHADS2"
                  >
                    <el-checkbox label="inCHADS2-0">
                      既往充血性心力衰竭(CHF)病史
                    </el-checkbox>
                    <el-checkbox label="inCHADS2-1"> 高血压</el-checkbox>
                    <el-checkbox label="inCHADS2-2"> 年龄≥75岁 </el-checkbox>
                    <el-checkbox label="inCHADS2-3"> 糖尿病 </el-checkbox>
                    <el-checkbox label="inCHADS2-4"> TIA或卒中病史 </el-checkbox>
                  </el-checkbox-group>
                  <span>住院CHADS2评分:<el-input
                    v-model="checkValue.inCHADS2.inCHADS2Score"
                    style="width: 100px"
                    disabled
                  />分<el-input
                    v-model="checkValue.inCHADS2.inCHADS2Risk"
                    style="width: 400px"
                    disabled
                  /></span>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">HAS-BLED评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-checkbox-group
                    v-model="checkValue.HASBLED.HASBLED"
                    @change="changeHASBLED()"
                  >
                    <el-checkbox label="HASBLED-0">高血压病</el-checkbox>
                    <el-checkbox label="HASBLED-1"> 肾功能异常 </el-checkbox>
                    <el-checkbox label="HASBLED-2"> 肝功能异常 </el-checkbox>
                    <el-checkbox label="HASBLED-3"> 先前有过卒中 </el-checkbox>
                    <el-checkbox label="HASBLED-4"> 有出血史或出血倾向 </el-checkbox>
                    <el-checkbox label="HASBLED-5"> 有过INR值不稳定历史 </el-checkbox>
                    <el-checkbox label="HASBLED-6"> 老年年龄>=65岁 </el-checkbox>
                    <el-checkbox label="HASBLED-7">
                      合用阿司匹林或NSAIDs药物
                    </el-checkbox>
                    <el-checkbox label="HASBLED-8"> 酗酒 </el-checkbox>
                  </el-checkbox-group>
                </div>
                <span>
                  HAS-BLED评分:
                  <el-input
                    v-model="checkValue.HASBLED.HASBLEDScore"
                    style="width: 100px"
                    disabled
                  />分<el-input
                    v-model="checkValue.HASBLED.HASBLEDRisk"
                    style="width: 400px"
                    disabled
                  />
                </span>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title red-star">出院GCS评分</div>
        </el-row>
        <el-form>
          <el-row>
            <el-row class="card">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-form-item label="睁眼状态">
                    <el-radio-group
                      v-model="checkValue.outGCS.outGCS.outGCS1"
                      @change="changeoutGCS()"
                    >
                      <el-radio label="1"> 1 无睁眼 </el-radio>
                      <el-radio label="2"> 2 疼痛刺激睁眼 </el-radio>
                      <el-radio label="3"> 3 语言刺激睁眼 </el-radio>
                      <el-radio label="4"> 4自发睁眼 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="语言状态">
                    <el-radio-group
                      v-model="checkValue.outGCS.outGCS.outGCS2"
                      @change="changeoutGCS()"
                    >
                      <el-radio label="1"> 1 无发音 </el-radio>
                      <el-radio label="2"> 2 只能发音 </el-radio>
                      <el-radio label="3"> 3 只能说 (不适当) 单词 </el-radio>
                      <el-radio label="4"> 4 言语错乱 </el-radio>
                      <el-radio label="5"> 5 正常交谈 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="运动状态">
                    <el-radio-group
                      v-model="checkValue.outGCS.outGCS.outGCS3"
                      @change="changeoutGCS()"
                    >
                      <el-radio label="1"> 1 无反应 </el-radio>
                      <el-radio label="2"> 2 异常伸展 (去脑状态) </el-radio>
                      <el-radio label="3"> 3 异常屈曲 (去皮层状态) </el-radio>
                      <el-radio label="4"> 4 对疼痛刺激屈曲反应 </el-radio>
                      <el-radio label="5"> 5 对疼痛刺激定位反应 </el-radio>
                      <el-radio label="6"> 6 按吩咐动作 </el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <span>
                    住院GCS评分:
                    <el-input
                      v-model="checkValue.outGCS.outGCSScore"
                      style="width: 100px"
                      disabled
                    />分<el-input
                      v-model="checkValue.outGCS.outGCSRisk"
                      style="width: 400px"
                      disabled
                    />
                  </span>
                </div>
              </el-row>
            </el-row>
          </el-row>
        </el-form>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">出院mRS</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-radio-group v-model="checkValue.outMRS.outMRS">
                    <el-radio label="0"> 0分 完全无症状 </el-radio>
                    <el-radio label="1">
                      1分 尽管有症状，但无明显功能障碍，能完成所有日常职责和活动
                    </el-radio>
                    <el-radio label="2">
                      2分 轻度残疾，不能完成病前所有活动，但不需要帮助，能照顾自己的事务
                    </el-radio>
                    <el-radio label="3">
                      3分 中度残疾，要求一些帮助，但行走不需要帮助
                    </el-radio>
                    <el-radio label="4">
                      4分 重度残疾，不能独立行走，无他人帮助不能满足自身需求
                    </el-radio>
                    <el-radio label="5">
                      5分 严重残疾，卧床、失禁、要求持续护理和关注
                    </el-radio>
                  </el-radio-group>
                </div>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">ABCD2评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-checkbox-group
                    v-model="checkValue.abcd2.abcd2"
                    @change="changeabcd2()"
                  >
                    <el-checkbox label="abcd2-0"> 年龄：≥60岁 </el-checkbox>
                    <el-checkbox label="abcd2-1"> 血压：≥140/90mmhg </el-checkbox>
                    <el-checkbox label="abcd2-2"> 临床表现：单侧肢体无力 </el-checkbox>
                    <el-checkbox label="abcd2-3">
                      临床表现：言语障碍不伴有肢体无力
                    </el-checkbox>
                    <el-checkbox label="abcd2-4"> 症状持续时间：≥60分钟 </el-checkbox>
                    <el-checkbox label="abcd2-5"> 症状持续时间：10~59分钟 </el-checkbox>
                    <el-checkbox label="abcd2-6"> 糖尿病：有糖尿病 </el-checkbox>
                  </el-checkbox-group>
                </div>
                <span>
                  ABCD2评分:
                  <el-input
                    v-model="checkValue.abcd2.abcd2Score"
                    style="width: 100px"
                    disabled
                  />分<el-input
                    v-model="checkValue.abcd2.abcd2Risk"
                    style="width: 400px"
                    disabled
                  />
                </span>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row class="form">
        <el-row class="form-row" type="flex" justify="space-between">
          <div class="form-title">ESSEN评分</div>
        </el-row>
        <el-row>
          <el-row class="card">
            <el-form label-width="80px">
              <el-row class="card-content">
                <div class="radio-flex">
                  <el-checkbox-group
                    v-model="checkValue.essen.essen"
                    @change="changeessen"
                  >
                    <el-checkbox label="essen-0" @change="changeAge($event,'essen-0')"> 年龄：65~74岁 </el-checkbox>
                    <el-checkbox label="essen-1" @change="changeAge($event,'essen-1')"> 年龄：≥75岁 </el-checkbox>
                    <el-checkbox label="essen-2"> 高血压病史 </el-checkbox>
                    <el-checkbox label="essen-3"> 既往心肌梗死 </el-checkbox>
                    <el-checkbox label="essen-4">
                      其他心血管疾病（除外心肌梗死和房颤）
                    </el-checkbox>
                    <el-checkbox label="essen-5"> 周围动脉疾病 </el-checkbox>
                    <el-checkbox label="essen-6"> 吸烟 </el-checkbox>
                    <el-checkbox label="essen-7"> 既往TIA或卒中病史 </el-checkbox>
                  </el-checkbox-group>
                </div>
                <span>
                  ESSEN评分:
                  <el-input
                    v-model="checkValue.essen.essenScore"
                    style="width: 100px"
                    disabled
                  />分<el-input
                    v-model="checkValue.essen.essenRisk"
                    style="width: 400px"
                    disabled
                  />
                </span>
              </el-row>
            </el-form>
          </el-row>
        </el-row>
      </el-row>
      <el-row>
        <el-button type="primary" class="floating-button" @click="saveScoreData()">
          保存
        </el-button>
      </el-row>
    </el-row>
  </div>
</template>

<script>
import { findStrokeDiagnose, saveStrokeDiagnose } from '@/api/green-channel/diagnoses'

export default {
  props: ['checkrowdata'], // 由主页面(父组件) 接收来的, 选择项的数据
  data() {
    return {
      diagnose: {
        cerebralInfarction: null,
        hematencephalon: null,
        isuia: null,
        cas: null
      },
      all_data: [],
      checkValue: {
        fast: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '11',
          userId: '',
          fast: {
            fast1: null,
            fast2: null,
            fast3: null,
            fast4: null,
            fast5: null
          },
          FASTScore: 0,
          FASTRisk: ''
        },
        swallow: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '12',
          userId: '',
          swallow: null
        },
        beFisher: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '13',
          userId: '',
          beFisher: null
        },
        beforeMRS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '14',
          userId: '',
          beforeMRS: null
        },
        inMRS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '15',
          userId: '',
          inMRS: null
        },
        beGCS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '16',
          userId: '',
          beGCS: {
            beGCS1: null,
            beGCS2: null,
            beGCS3: null
          },
          beGCSScore: 0,
          beGCSRisk: ''
        },
        after24MRS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '17',
          userId: '',
          after24MRS: null
        },
        inGCS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '18',
          userId: '',
          inGCS: {
            inGCS1: null,
            inGCS2: null,
            inGCS3: null
          },
          inGCSScore: 0,
          inGCSRisk: ''
        },
        inHuntHess: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '19',
          userId: '',
          inHuntHess: null
        },
        inCHADS2: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '20',
          userId: '',
          inCHADS2: [],
          inCHADS2Score: 0,
          inCHADS2Risk: ''
        },
        HASBLED: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '21',
          userId: '',
          HASBLED: [],
          HASBLEDScore: 0,
          HASBLEDRisk: ''
        },
        outGCS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '22',
          userId: '',
          outGCS: {
            outGCS1: null,
            outGCS2: null,
            outGCS3: null
          },
          outGCSScore: 0,
          outGCSRisk: ''
        },
        outMRS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '23',
          userId: '',
          outMRS: null
        },
        onsetMRS: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '24',
          userId: '',
          onsetMRS: null
        },
        abcd2: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '25',
          userId: '',
          abcd2: [],
          abcd2Score: 0,
          abcd2Risk: ''
        },
        essen: {
          id: '',
          createdAt: '',
          remark: '',
          updatedAt: '',
          department: '',
          medicalId: '',
          type: '26',
          userId: '',
          essen: [],
          essenScore: 0,
          essenRisk: ''
        }
      },

      fast1List: [
        {
          code: '0',
          name: '正常或轻微面瘫'
        },
        {
          code: '1',
          name: '部分或完全面瘫'
        }
      ],
      fast2List: [
        {
          code: '0',
          name: '无瘫痪'
        },
        {
          code: '1',
          name: '有瘫痪/抗部分重力'
        },
        {
          code: '2',
          name: '不能抗重力/无活动'
        }
      ],
      fast3List: [
        {
          code: '0',
          name: '无语言障碍'
        },
        {
          code: '1',
          name: '轻-中度'
        },
        {
          code: '2',
          name: '严重，全面失语，缄默'
        }
      ],
      fast4List: [
        {
          code: '0',
          name: '无'
        },
        {
          code: '1',
          name: '部分'
        },
        {
          code: '2',
          name: '强迫凝视'
        }
      ],
      fast5List: [
        {
          code: '0',
          name: '无'
        },
        {
          code: '1',
          name: '不能感知双侧同时的中感觉刺激'
        },
        {
          code: '2',
          name: '不能识别自己的手或仅能感知一次肢体'
        }
      ],
      isHaveDiagnose: false
    }
  },
  created() {},
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.findStrokeDiagnose()
    },

    findStrokeDiagnose() {
      findStrokeDiagnose({
        dispatchId: this.checkrowdata.dispatchId
      }).then((res) => {
        // console.log(res)
        if (res.data) {
          // console.log('res.data', res.data)
          this.all_data = res.data
          res.data.forEach((el) => {
            if (el.type === '11') {
              const temp_value = el.fast.split('|')
              this.checkValue.fast.id = el.id
              this.checkValue.fast.createdAt = el.createdAt
              this.checkValue.fast.department = el.department
              this.checkValue.fast.dispatchId = el.dispatchId
              this.checkValue.fast.medicalId = el.medicalId
              this.checkValue.fast.remark = el.remark
              this.checkValue.fast.updatedAt = el.updatedAt
              this.checkValue.fast.userId = el.userId
              this.checkValue.fast.fast.fast1 = temp_value[0]
              this.checkValue.fast.fast.fast2 = temp_value[1]
              this.checkValue.fast.fast.fast3 = temp_value[2]
              this.checkValue.fast.fast.fast4 = temp_value[3]
              this.checkValue.fast.fast.fast5 = temp_value[4]
            }

            if (el.type === '12') {
              this.checkValue.swallow.id = el.id
              this.checkValue.swallow.createdAt = el.createdAt
              this.checkValue.swallow.department = el.department
              this.checkValue.swallow.dispatchId = el.dispatchId
              this.checkValue.swallow.medicalId = el.medicalId
              this.checkValue.swallow.remark = el.remark
              this.checkValue.swallow.updatedAt = el.updatedAt
              this.checkValue.swallow.userId = el.userId
              this.checkValue.swallow.swallow = el.swallow
            }
            if (el.type === '13') {
              this.checkValue.beFisher.id = el.id
              this.checkValue.beFisher.createdAt = el.createdAt
              this.checkValue.beFisher.department = el.department
              this.checkValue.beFisher.dispatchId = el.dispatchId
              this.checkValue.beFisher.medicalId = el.medicalId
              this.checkValue.beFisher.remark = el.remark
              this.checkValue.beFisher.updatedAt = el.updatedAt
              this.checkValue.beFisher.userId = el.userId
              this.checkValue.beFisher.beFisher = el.beFisher
            }
            if (el.type === '14') {
              this.checkValue.beforeMRS.id = el.id
              this.checkValue.beforeMRS.createdAt = el.createdAt
              this.checkValue.beforeMRS.department = el.department
              this.checkValue.beforeMRS.dispatchId = el.dispatchId
              this.checkValue.beforeMRS.medicalId = el.medicalId
              this.checkValue.beforeMRS.remark = el.remark
              this.checkValue.beforeMRS.updatedAt = el.updatedAt
              this.checkValue.beforeMRS.userId = el.userId
              this.checkValue.beforeMRS.beforeMRS = el.beforeMRS
            }
            if (el.type === '15') {
              this.checkValue.inMRS.id = el.id
              this.checkValue.inMRS.createdAt = el.createdAt
              this.checkValue.inMRS.department = el.department
              this.checkValue.inMRS.dispatchId = el.dispatchId
              this.checkValue.inMRS.medicalId = el.medicalId
              this.checkValue.inMRS.remark = el.remark
              this.checkValue.inMRS.updatedAt = el.updatedAt
              this.checkValue.inMRS.userId = el.userId
              this.checkValue.inMRS.inMRS = el.inMRS
            }
            if (el.type === '16') {
              this.checkValue.beGCS.id = el.id
              this.checkValue.beGCS.createdAt = el.createdAt
              this.checkValue.beGCS.department = el.department
              this.checkValue.beGCS.dispatchId = el.dispatchId
              this.checkValue.beGCS.medicalId = el.medicalId
              this.checkValue.beGCS.remark = el.remark
              this.checkValue.beGCS.updatedAt = el.updatedAt
              this.checkValue.beGCS.userId = el.userId
              const temp_value = el.beGCS.split('|')
              if (temp_value.length == 1) {
                this.checkValue.beGCS.beGCS.beGCS1 = temp_value[0]
              }
              if (temp_value.length == 2) {
                this.checkValue.beGCS.beGCS.beGCS1 = temp_value[0]
                this.checkValue.beGCS.beGCS.beGCS2 = temp_value[1]
              }
              if (temp_value.length == 3) {
                this.checkValue.beGCS.beGCS.beGCS1 = temp_value[0]
                this.checkValue.beGCS.beGCS.beGCS2 = temp_value[1]
                this.checkValue.beGCS.beGCS.beGCS3 = temp_value[2]
              }
            }
            if (el.type === '17') {
              this.checkValue.after24MRS.id = el.id
              this.checkValue.after24MRS.createdAt = el.createdAt
              this.checkValue.after24MRS.department = el.department
              this.checkValue.after24MRS.dispatchId = el.dispatchId
              this.checkValue.after24MRS.medicalId = el.medicalId
              this.checkValue.after24MRS.remark = el.remark
              this.checkValue.after24MRS.updatedAt = el.updatedAt
              this.checkValue.after24MRS.userId = el.userId
              this.checkValue.after24MRS.after24MRS = el.after24MRS
            }
            if (el.type === '18') {
              this.checkValue.inGCS.id = el.id
              this.checkValue.inGCS.createdAt = el.createdAt
              this.checkValue.inGCS.department = el.department
              this.checkValue.inGCS.dispatchId = el.dispatchId
              this.checkValue.inGCS.medicalId = el.medicalId
              this.checkValue.inGCS.remark = el.remark
              this.checkValue.inGCS.updatedAt = el.updatedAt
              this.checkValue.inGCS.userId = el.userId
              const temp_value = el.inGCS.split('|')
              if (temp_value.length == 1) {
                this.checkValue.inGCS.inGCS.inGCS1 = temp_value[0]
              }
              if (temp_value.length == 2) {
                this.checkValue.inGCS.inGCS.inGCS1 = temp_value[0]
                this.checkValue.inGCS.inGCS.inGCS2 = temp_value[1]
              }
              if (temp_value.length == 3) {
                this.checkValue.inGCS.inGCS.inGCS1 = temp_value[0]
                this.checkValue.inGCS.inGCS.inGCS2 = temp_value[1]
                this.checkValue.inGCS.inGCS.inGCS3 = temp_value[2]
              }
            }
            if (el.type === '19') {
              this.checkValue.inHuntHess.id = el.id
              this.checkValue.inHuntHess.createdAt = el.createdAt
              this.checkValue.inHuntHess.department = el.department
              this.checkValue.inHuntHess.dispatchId = el.dispatchId
              this.checkValue.inHuntHess.medicalId = el.medicalId
              this.checkValue.inHuntHess.remark = el.remark
              this.checkValue.inHuntHess.updatedAt = el.updatedAt
              this.checkValue.inHuntHess.userId = el.userId
              this.checkValue.inHuntHess.inHuntHess = el.inHuntHess
            }
            if (el.type === '20') {
              this.checkValue.inCHADS2.id = el.id
              this.checkValue.inCHADS2.createdAt = el.createdAt
              this.checkValue.inCHADS2.department = el.department
              this.checkValue.inCHADS2.dispatchId = el.dispatchId
              this.checkValue.inCHADS2.medicalId = el.medicalId
              this.checkValue.inCHADS2.remark = el.remark
              this.checkValue.inCHADS2.updatedAt = el.updatedAt
              this.checkValue.inCHADS2.userId = el.userId
              const temp_value = el.inCHADS2.split('|')
              for (let i = 0; i < temp_value.length; i++) {
                if (Number(temp_value[i]) !== 0) {
                  this.checkValue.inCHADS2.inCHADS2[i] = 'inCHADS2-' + i
                } else {
                  this.checkValue.inCHADS2.inCHADS2[i] = 0
                }
              }
            }
            if (el.type === '21') {
              this.checkValue.HASBLED.id = el.id
              this.checkValue.HASBLED.createdAt = el.createdAt
              this.checkValue.HASBLED.department = el.department
              this.checkValue.HASBLED.dispatchId = el.dispatchId
              this.checkValue.HASBLED.medicalId = el.medicalId
              this.checkValue.HASBLED.remark = el.remark
              this.checkValue.HASBLED.updatedAt = el.updatedAt
              this.checkValue.HASBLED.userId = el.userId
              if (el.HASBLED) {
                const temp_value = el.HASBLED.split('|')
                for (let i = 0; i < temp_value.length; i++) {
                  if (Number(temp_value[i]) !== 0) {
                    this.checkValue.HASBLED.HASBLED[i] = 'HASBLED-' + i
                  } else {
                    this.checkValue.HASBLED.HASBLED[i] = 0
                  }
                }
              }
            }
            if (el.type === '22') {
              this.checkValue.outGCS.id = el.id
              this.checkValue.outGCS.createdAt = el.createdAt
              this.checkValue.outGCS.department = el.department
              this.checkValue.outGCS.dispatchId = el.dispatchId
              this.checkValue.outGCS.medicalId = el.medicalId
              this.checkValue.outGCS.remark = el.remark
              this.checkValue.outGCS.updatedAt = el.updatedAt
              this.checkValue.outGCS.userId = el.userId
              const temp_value = el.outGCS.split('|')
              if (temp_value.length == 1) {
                this.checkValue.outGCS.outGCS.outGCS1 = temp_value[0]
              }
              if (temp_value.length == 2) {
                this.checkValue.outGCS.outGCS.outGCS1 = temp_value[0]
                this.checkValue.outGCS.outGCS.outGCS2 = temp_value[1]
              }
              if (temp_value.length == 3) {
                this.checkValue.outGCS.outGCS.outGCS1 = temp_value[0]
                this.checkValue.outGCS.outGCS.outGCS2 = temp_value[1]
                this.checkValue.outGCS.outGCS.outGCS3 = temp_value[2]
              }
            }
            if (el.type === '23') {
              this.checkValue.outMRS.id = el.id
              this.checkValue.outMRS.createdAt = el.createdAt
              this.checkValue.outMRS.department = el.department
              this.checkValue.outMRS.dispatchId = el.dispatchId
              this.checkValue.outMRS.medicalId = el.medicalId
              this.checkValue.outMRS.remark = el.remark
              this.checkValue.outMRS.updatedAt = el.updatedAt
              this.checkValue.outMRS.userId = el.userId
              this.checkValue.outMRS.outMRS = el.outMRS
            }
            if (el.type === '24') {
              this.checkValue.onsetMRS.id = el.id
              this.checkValue.onsetMRS.createdAt = el.createdAt
              this.checkValue.onsetMRS.department = el.department
              this.checkValue.onsetMRS.dispatchId = el.dispatchId
              this.checkValue.onsetMRS.medicalId = el.medicalId
              this.checkValue.onsetMRS.remark = el.remark
              this.checkValue.onsetMRS.updatedAt = el.updatedAt
              this.checkValue.onsetMRS.userId = el.userId
              this.checkValue.onsetMRS.onsetMRS = el.onsetMRS
            }
            if (el.type === '25') {
              this.checkValue.abcd2.id = el.id
              this.checkValue.abcd2.createdAt = el.createdAt
              this.checkValue.abcd2.department = el.department
              this.checkValue.abcd2.dispatchId = el.dispatchId
              this.checkValue.abcd2.medicalId = el.medicalId
              this.checkValue.abcd2.remark = el.remark
              this.checkValue.abcd2.updatedAt = el.updatedAt
              this.checkValue.abcd2.userId = el.userId
              const temp_value = el.abcd2.split('|')
              for (let i = 0; i < temp_value.length; i++) {
                if (Number(temp_value[i]) !== 0) {
                  this.checkValue.abcd2.abcd2[i] = 'abcd2-' + i
                } else {
                  this.checkValue.abcd2.abcd2[i] = 0
                }
              }
            }
            if (el.type === '26') {
              this.checkValue.essen.id = el.id
              this.checkValue.essen.createdAt = el.createdAt
              this.checkValue.essen.department = el.department
              this.checkValue.essen.dispatchId = el.dispatchId
              this.checkValue.essen.medicalId = el.medicalId
              this.checkValue.essen.remark = el.remark
              this.checkValue.essen.updatedAt = el.updatedAt
              this.checkValue.essen.userId = el.userId
              const temp_value = el.essen.split('|')
              for (let i = 0; i < temp_value.length; i++) {
                if (Number(temp_value[i]) !== 0) {
                  this.checkValue.essen.essen[i] = 'essen-' + i
                } else {
                  this.checkValue.essen.essen[i] = 0
                }
              }
            }
            if (el.type === '1') {
              this.diagnose.cerebralInfarction = el.cerebralInfarction
              this.diagnose.hematencephalon = el.hematencephalon
              this.diagnose.isuia = el.isuia
              this.diagnose.cas = el.cas

              for (const isdia in this.diagnose) {
                if (this.diagnose[isdia] === '1') {
                  this.isHaveDiagnose = true
                }
              }

              // console.log(this.diagnose)
            }
          })
          this.initInCHADS2()
          this.initHASBLED()
          this.initFAST()
          this.initbeGCSS()
          this.initinGCS()
          this.initoutGCS()
          this.initabcd2()
          this.initessen()
        }
      })
    },
    saveStrokeDiagnose(data) {
      saveStrokeDiagnose(data).then((res) => {
        if (res.code === 0) {
          this.$message.success('保存成功')
          this.openAddDiagnosis = false
          this.openAddComplication = false
          this.findStrokeDiagnose()
        } else {
          this.$message.error('保存失败')
        }
      })
    },
    initInCHADS2() {
      this.checkValue.inCHADS2.inCHADS2Score = 0
      this.checkValue.inCHADS2.inCHADS2.forEach((el) => {
        if (el === 'inCHADS2-0') {
          this.checkValue.inCHADS2.inCHADS2Score += 1
        }
        if (el === 'inCHADS2-1') {
          this.checkValue.inCHADS2.inCHADS2Score += 1
        }
        if (el === 'inCHADS2-2') {
          this.checkValue.inCHADS2.inCHADS2Score += 1
        }
        if (el === 'inCHADS2-3') {
          this.checkValue.inCHADS2.inCHADS2Score += 1
        }
        if (el === 'inCHADS2-4') {
          this.checkValue.inCHADS2.inCHADS2Score += 2
        }
      })
      if (this.checkValue.inCHADS2.inCHADS2Score === 0) {
        this.checkValue.inCHADS2.inCHADS2Risk = '低风险'
      } else if (
        this.checkValue.inCHADS2.inCHADS2Score >= 1 &&
        this.checkValue.inCHADS2.inCHADS2Score <= 2
      ) {
        this.checkValue.inCHADS2.inCHADS2Risk = '中风险'
      } else if (this.checkValue.inCHADS2.inCHADS2Score > 2) {
        this.checkValue.inCHADS2.inCHADS2Risk = '高风险'
      }
    },
    initHASBLED() {
      this.checkValue.HASBLED.HASBLEDScore = 0
      this.checkValue.HASBLED.HASBLED.forEach((el) => {
        if (el === 'HASBLED-0') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-1') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-2') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-3') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-4') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-5') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-6') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-7') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
        if (el === 'HASBLED-8') {
          this.checkValue.HASBLED.HASBLEDScore += 1
        }
      })
      if (this.checkValue.HASBLED.HASBLEDScore === 0) {
        this.checkValue.HASBLED.HASBLEDRisk = '低风险'
      } else if (
        this.checkValue.HASBLED.HASBLEDScore >= 1 &&
        this.checkValue.HASBLED.HASBLEDScore <= 2
      ) {
        this.checkValue.HASBLED.HASBLEDRisk = '中风险'
      } else if (this.checkValue.HASBLED.HASBLEDScore > 2) {
        this.checkValue.HASBLED.HASBLEDRisk = '高风险'
      }
    },
    initFAST() {
      this.checkValue.fast.FASTScore = 0

      for (const element in this.checkValue.fast.fast) {
        this.checkValue.fast.FASTScore += Number(this.checkValue.fast.fast[element])
      }

      if (this.checkValue.fast.FASTScore === 0) {
        this.checkValue.fast.FASTRisk = '非卒中'
      } else if (this.checkValue.fast.FASTScore === 1) {
        this.checkValue.fast.FASTRisk = '疑似卒中'
      } else if (this.checkValue.fast.FASTScore > 1) {
        this.checkValue.fast.FASTRisk = '疑似大血管闭塞卒中'
      }
    },
    initbeGCSS() {
      this.checkValue.beGCS.beGCSScore = 0
      this.checkValue.beGCS.beGCSScore =
        Number(this.checkValue.beGCS.beGCS.beGCS1) +
        Number(this.checkValue.beGCS.beGCS.beGCS2) +
        Number(this.checkValue.beGCS.beGCS.beGCS3)
      if (this.checkValue.beGCS.beGCSScore <= 5) {
        this.checkValue.beGCS.beGCSRisk = '特重度/颅脑损伤'
      } else if (
        this.checkValue.beGCS.beGCSScore > 5 &&
        this.checkValue.beGCS.beGCSScore < 9
      ) {
        this.checkValue.beGCS.beGCSRisk = '重度/颅脑损伤'
      } else if (
        this.checkValue.beGCS.beGCSScore >= 9 &&
        this.checkValue.beGCS.beGCSScore < 13
      ) {
        this.checkValue.beGCS.beGCSRisk = '中度/颅脑损伤'
      } else if (
        this.checkValue.beGCS.beGCSScore >= 13 &&
        this.checkValue.beGCS.beGCSScore < 16
      ) {
        this.checkValue.beGCS.beGCSRisk = '轻度/颅脑损伤'
      }
    },
    initinGCS() {
      this.checkValue.inGCS.inGCSScore = 0
      this.checkValue.inGCS.inGCSScore =
        Number(this.checkValue.inGCS.inGCS.inGCS1) +
        Number(this.checkValue.inGCS.inGCS.inGCS2) +
        Number(this.checkValue.inGCS.inGCS.inGCS3)
      if (this.checkValue.inGCS.inGCSScore <= 5) {
        this.checkValue.inGCS.inGCSRisk = '特重度/颅脑损伤'
      } else if (
        this.checkValue.inGCS.inGCSScore > 5 &&
        this.checkValue.inGCS.inGCSScore < 9
      ) {
        this.checkValue.inGCS.inGCSRisk = '重度/颅脑损伤'
      } else if (
        this.checkValue.inGCS.inGCSScore >= 9 &&
        this.checkValue.inGCS.inGCSScore < 13
      ) {
        this.checkValue.inGCS.inGCSRisk = '中度/颅脑损伤'
      } else if (
        this.checkValue.inGCS.inGCSScore >= 13 &&
        this.checkValue.inGCS.inGCSScore < 16
      ) {
        this.checkValue.inGCS.inGCSRisk = '轻度/颅脑损伤'
      }
    },
    initoutGCS() {
      this.checkValue.outGCS.outGCSScore = 0
      this.checkValue.outGCS.outGCSScore =
        Number(this.checkValue.outGCS.outGCS.outGCS1) +
        Number(this.checkValue.outGCS.outGCS.outGCS2) +
        Number(this.checkValue.outGCS.outGCS.outGCS3)
      if (this.checkValue.outGCS.outGCSScore <= 5) {
        this.checkValue.outGCS.outGCSRisk = '特重度/颅脑损伤'
      } else if (
        this.checkValue.outGCS.outGCSScore > 5 &&
        this.checkValue.outGCS.outGCSScore < 9
      ) {
        this.checkValue.outGCS.outGCSRisk = '重度/颅脑损伤'
      } else if (
        this.checkValue.outGCS.outGCSScore >= 9 &&
        this.checkValue.outGCS.outGCSScore < 13
      ) {
        this.checkValue.outGCS.outGCSRisk = '中度/颅脑损伤'
      } else if (
        this.checkValue.outGCS.outGCSScore >= 13 &&
        this.checkValue.outGCS.outGCSScore < 16
      ) {
        this.checkValue.outGCS.outGCSRisk = '轻度/颅脑损伤'
      }
    },
    initabcd2() {
      this.checkValue.abcd2.abcd2Score = 0
      this.checkValue.abcd2.abcd2.forEach((el) => {
        if (el === 'abcd2-0') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-1') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-2') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-3') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-4') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-5') {
          this.checkValue.abcd2.abcd2Score += 1
        }
        if (el === 'abcd2-6') {
          this.checkValue.abcd2.abcd2Score += 1
        }
      })
      if (this.checkValue.abcd2.abcd2Score <= 3) {
        this.checkValue.abcd2.abcd2Risk = '低风险'
      } else if (
        this.checkValue.abcd2.abcd2Score >= 4 &&
        this.checkValue.abcd2.abcd2Score <= 5
      ) {
        this.checkValue.abcd2.abcd2Risk = '中风险'
      } else if (this.checkValue.abcd2.abcd2Score > 5) {
        this.checkValue.abcd2.abcd2Risk = '高风险'
      }
      // console.log(this.checkValue.abcd2.abcd2)
    },
    initessen() {
      this.checkValue.essen.essenScore = 0
      this.checkValue.essen.essen.forEach((el) => {
        if (el === 'essen-0') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-1') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-2') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-3') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-4') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-5') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-6') {
          this.checkValue.essen.essenScore += 1
        }
        if (el === 'essen-7') {
          this.checkValue.essen.essenScore += 1
        }
      })
      if (this.checkValue.essen.essenScore <= 6) {
        this.checkValue.essen.essenRisk = '卒中复发低风险'
      } else if (this.checkValue.essen.essenScore > 6) {
        this.checkValue.essen.essenRisk = '卒中复发极高风险'
      }
      // console.log(this.checkValue.essen.essen)
    },
    changeinCHADS2() {
      this.initInCHADS2()
    },
    changeHASBLED() {
      this.initHASBLED()
    },
    changeFAST() {
      this.initFAST()
    },
    changebeGCSS() {
      this.initbeGCSS()
    },
    changeinGCS() {
      this.initinGCS()
    },
    changeoutGCS() {
      this.initoutGCS()
    },
    changeabcd2() {
      this.initabcd2()
    },
    changeessen(e) {
      this.initessen()
    },
    changeAge(e, e1) {
      // console.log("e"+e)
      // console.log("e1"+e1)
      // console.log(this.checkValue.essen.essen)
      if (e) {
        if (e1 === 'essen-1' && this.checkValue.essen.essen.indexOf('essen-0') !== -1) {
          console.log(this.checkValue.essen.essen.indexOf('essen-0'))
          this.checkValue.essen.essen[this.checkValue.essen.essen.indexOf('essen-0')] = 0
        } else if (e1 === 'essen-0' && this.checkValue.essen.essen.indexOf('essen-1') !== -1) {
          console.log(this.checkValue.essen.essen.indexOf('essen-1'))
          this.checkValue.essen.essen[this.checkValue.essen.essen.indexOf('essen-1')] = 0
        }
      }
    },
    saveScoreData() {
      // console.log("保存");
      let saveData = this.initToSaveData()

      for(let i=saveData.length-1;i>=0;i--){
        
        switch (saveData[i].type) {
          case "16":
            if(saveData[i].beGCS[0] === "|"){
              saveData.splice(i,1)
            }
            break;
          case "18":
            if(saveData[i].inGCS[0] === "|"){
              saveData.splice(i,1)
            }
            break;  
          case "22":
            if(saveData[i].outGCS[0] === "|"){
              saveData.splice(i,1)
            }
            break;  
          default:
            break;
        }
      }
      // console.log(saveData)
      // return 
      this.saveStrokeDiagnose(saveData)
    },
    initToSaveData() {
      // console.log(this.checkrowdata);

      const data_arr = []
      let temp_data = Object.assign({}, this.checkValue.fast)
      if (
        temp_data.fast.fast1 &&
        temp_data.fast.fast2 &&
        temp_data.fast.fast3 &&
        temp_data.fast.fast4 &&
        temp_data.fast.fast5
      ) {
        const temp_arr = []
        for (const el in temp_data.fast) {
          temp_arr.push(temp_data.fast[el])
        }
        temp_data.fast = temp_arr.join('|')
        delete temp_data.FASTRisk
        delete temp_data.FASTScore
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.swallow)
      if (temp_data.swallow) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.beFisher)
      if (temp_data.beFisher) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.beforeMRS)
      if (temp_data.beforeMRS) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.inMRS)
      if (temp_data.inMRS) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.beGCS)
      if (temp_data.beGCS) {
        const temp_arr = []
        for (const el in temp_data.beGCS) {
          temp_arr.push(temp_data.beGCS[el])
        }
        temp_data.beGCS = temp_arr.join('|')
        delete temp_data.beGCSRisk
        delete temp_data.beGCSScore
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.after24MRS)
      if (temp_data.after24MRS) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.inGCS)
      if (temp_data.inGCS) {
        const temp_arr = []
        for (const el in temp_data.inGCS) {
          temp_arr.push(temp_data.inGCS[el])
        }
        temp_data.inGCS = temp_arr.join('|')
        delete temp_data.inGCSRisk
        delete temp_data.inGCSScore
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.inHuntHess)
      if (temp_data.inHuntHess) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.inCHADS2)
      if (temp_data.inCHADS2 && temp_data.inCHADS2.length > 0) {
        const temp_arr = [0, 0, 0, 0, 0]
        temp_data.inCHADS2.forEach((el) => {
          const match_data = el ? el.match(/[-]{1}[0-9]{1}/) : null
          if (match_data) {
            temp_arr[Number(match_data[0].replace('-', ''))] = 1
          }
        })
        temp_data.inCHADS2 = temp_arr.join('|')
        data_arr.push(temp_data)
      }

      temp_data = Object.assign({}, this.checkValue.HASBLED)
      if (temp_data.HASBLED && temp_data.HASBLED.length > 0) {
        const temp_arr = [0, 0, 0, 0, 0, 0, 0, 0, 0]
        temp_data.HASBLED.forEach((el) => {
          const match_data = el ? el.match(/[-]{1}[0-9]{1}/) : null
          if (match_data) {
            temp_arr[Number(match_data[0].replace('-', ''))] = 1
          }
        })
        temp_data.HASBLED = temp_arr.join('|')
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.outGCS)
      if (temp_data.outGCS) {
        const temp_arr = []
        for (const el in temp_data.outGCS) {
          temp_arr.push(temp_data.outGCS[el])
        }
        temp_data.outGCS = temp_arr.join('|')
        delete temp_data.outGCSRisk
        delete temp_data.outGCSScore
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.outMRS)
      if (temp_data.outMRS) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.onsetMRS)
      if (temp_data.onsetMRS) {
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.abcd2)
      if (temp_data.abcd2 && temp_data.abcd2.length > 0) {
        const temp_arr = [0, 0, 0, 0, 0, 0, 0]
        temp_data.abcd2.forEach((el) => {
          const match_data = el ? el.match(/[-]{1}[0-9]{1}/) : null
          if (match_data) {
            temp_arr[Number(match_data[0].replace('-', ''))] = 1
          }
        })
        temp_data.abcd2 = temp_arr.join('|')
        data_arr.push(temp_data)
      }
      temp_data = Object.assign({}, this.checkValue.essen)
      if (temp_data.essen && temp_data.essen.length > 0) {
        const temp_arr = [0, 0, 0, 0, 0, 0, 0, 0]
        temp_data.essen.forEach((el) => {
          const match_data = el ? el.match(/[-]{1}[0-9]{1}/) : null
          if (match_data) {
            temp_arr[Number(match_data[0].replace('-', ''))] = 1
          }
        })
        temp_data.essen = temp_arr.join('|')
        data_arr.push(temp_data)
      }
      data_arr.forEach((el) => {
        el.medicalId = this.checkrowdata.medicalId
        el.dispatchId = this.checkrowdata.dispatchId
        el.userId = this.checkrowdata.userId
      })
      return data_arr
    }
  }
}
</script>

<style lang="scss" scoped>
.body {
  padding-left: 20px;
  padding-right: 20px;

  .no-data {
    padding: 20px 40px;
  }

  .title {
    margin-bottom: 12px;
    font-size: 20px;
    color: #1890ff;

    .crumb {
      display: flex;
      align-items: center;
    }
  }

  .form {
    margin: 0px 25px 20px 15px;
    padding-bottom: 0px;
    border: 1px solid #dcdfe6;

    &-title {
      display: flex;
      align-items: center;
      line-height: 36px;
    }

    &-row {
      padding-right: 20px;
      padding: 12px 30px;
      border-bottom: 1px solid #dcdfe6;
    }
  }

  .card {
    margin: -1px 45px 0px 35px;
    padding: 10px 20px 0px 10px;
    border-top: 1px dashed #dcdfe6;
    border-radius: 4px;

    &-title,
    &-subTitle {
      margin-bottom: 10px;
      font-size: 15px;

      .right {
        display: flex;
        justify-content: flex-end;

        div {
          padding-left: 20px;
        }
      }

      .content {
        display: flex;
        align-items: center;
      }
    }

    &-subTitle {
      padding: 7px 0;
    }

    &-content {
      padding-left: 30px;
      font-size: 14px !important;

      .el-radio {
        min-width: 80px;
      }

      .radio-flex,
      .radio-flex-small {
        .small-distance {
          margin-right: 0px;
          min-width: 60px !important;
        }

        .el-radio {
          min-width: 110px;
          margin: 0px 20px 20px 0px;
        }

        .el-checkbox {
          margin: 0px 10px 20px 0px !important;
          min-width: 226.3px;
        }
      }

      .radio-flex-small {
        .el-checkbox {
          min-width: 110px;
        }
      }

      .check {
        width: 750px;
      }

      &-result {
        margin: 0px 0px 20px;
      }

      .radio-box .el-radio {
        min-width: 230px;
        padding: 3px 0;
      }

      &-title {
        display: flex;
        flex: 0 0 45px;
        align-items: center;
      }

      &-subTitle {
        display: flex;
        flex: 0 0 45px;
      }

      .inspect {
        width: 750px;
      }

      .project {
        width: 1000px;
      }

      .result-grade {
        .el-input {
          width: 280px;
        }
      }

      .result-score {
        padding-left: 20px;
        padding-right: 10px;

        .el-input {
          width: 50px;
        }
      }
    }

    .item {
      padding-top: 6px;
      padding-bottom: 6px;
    }
  }
}

div.red-star::before {
  content: "*";
  color: red;
}

.floating-button {
  position: fixed;
  /* 固定在屏幕上 */
  bottom: 70%;
  /* 距离屏幕底部的距离 */
  right: 50px;
  /* 按钮内边距 */
  // border-radius: 50%;
  /* 将按钮设为圆形 */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  /* 添加阴影效果 */
  font-size: 15px;

  text-align: center;
  cursor: pointer;
  /* 鼠标悬停时显示手型光标 */
}
</style>
